import vue from '@vitejs/plugin-vue'

import createAutoImport from './plugins/auto-import'
import createSvgIcon from './plugins/svg-icon'
import createCompression from './plugins/compression'
import createSetupExtend from './plugins/setup-extend'
import DevTools from 'vite-plugin-vue-devtools'

export default function createVitePlugins(viteEnv, isBuild = false) {
  const vitePlugins = [vue()]
  vitePlugins.push(createAutoImport())
  vitePlugins.push(createSetupExtend())
  vitePlugins.push(createSvgIcon(isBuild))
  isBuild && vitePlugins.push(...createCompression(viteEnv))
  // !isBuild && vitePlugins.push(DevTools())
  return vitePlugins
}
